package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.InstitutionTypeAddDTO;
import org.jsola.hr.dto.InstitutionTypeUpdateDTO;
import org.jsola.hr.query.InstitutionTypeQuery;
import org.jsola.hr.vo.InstitutionStatisticalVO;
import org.jsola.hr.vo.InstitutionTypeListVO;
import org.jsola.hr.vo.InstitutionTypeVO;

import java.util.List;

/**
 * 制度分类
 *
 * @author zhr
 */
@Api(tags = "hr-制度分类")
public interface IInstitutionTypeControllerAPI {

    /**
     * 新增制度分类
     *
     * @param institutionTypeAddDTO 制度分类新增实体
     * @return 制度分类展示对象
     */
    @ApiOperation(value = "新增制度分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeAddDTO", dataType = "InstitutionTypeAddDTO", value = "新增制度分类", paramType = "body")
    })
    Result<InstitutionTypeVO> save(InstitutionTypeAddDTO institutionTypeAddDTO);


    /**
     * 修改制度分类
     *
     * @param institutionTypeUpdateDTO 制度分类
     * @return 更新数量
     */
    @ApiOperation(value = "修改制度分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeUpdateDTO", dataType = "InstitutionTypeUpdateDTO", value = "修改制度分类", paramType = "body")
    })
    Result<Integer> update(InstitutionTypeUpdateDTO institutionTypeUpdateDTO);


    /**
     * 删除单个制度分类，彻底删除
     *
     * @param institutionTypeId 制度分类id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个制度分类，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeId", dataType = "String", value = "制度分类id", paramType = "path")
    })
    Result<Integer> delete(String institutionTypeId);


    /**
     * 批量删除制度分类，彻底删除
     *
     * @param institutionTypeIds 制度分类id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除制度分类，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeIds", dataType = "String[]", value = "制度分类id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] institutionTypeIds);


    /**
     * 根据制度分类id查询制度分类详情
     *
     * @param institutionTypeId 制度分类id
     * @return 制度分类详情
     */
    @ApiOperation(value = "根据制度分类id查询制度分类详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeId", dataType = "String", value = "制度分类id", paramType = "path")
    })
    Result<InstitutionTypeVO> findById(String institutionTypeId);


    /**
     * 查询制度分类
     *
     * @param institutionTypeQuery 制度分类查询参数
     * @return page
     */
    @ApiOperation(value = "查询制度分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeQuery", dataType = "InstitutionTypeQuery", value = "制度分类查询参数", paramType = "query")
    })
    Result<List<InstitutionTypeListVO>> listAll(InstitutionTypeQuery institutionTypeQuery);


    /**
     * 分页查询制度分类
     *
     * @param institutionTypeQuery 制度分类查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询制度分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionTypeQuery", dataType = "InstitutionTypeQuery", value = "制度分类查询参数", paramType = "query")
    })
    Result<Page<InstitutionTypeListVO>> page(InstitutionTypeQuery institutionTypeQuery);


    /**
     * 查询用工单位下制度分类及制度(树形结构)
     *
     * @return 制度分类列表
     */
    Result<List<InstitutionTypeListVO>> selectBySite(String companyId);


    /**
     * 查询站点下一级分类
     *
     * @return 制度分类列表
     */
    Result<List<InstitutionTypeListVO>> selectFirstBySite();

    /**
     * 查询用工单位下制度分类及制度
     *
     * @return 制度分类列表
     */
    Result<InstitutionStatisticalVO> selectInstitutionByCompanyId(String companyId);
}

